package com.wp.controller;

import com.wp.pojo.Right;
import com.wp.pojo.basePojo.SysResult;
import com.wp.service.RightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/rights")
@CrossOrigin
public class RightController {
    @Autowired
    private RightService rightService;
    /**
     * 获取所有菜单列表
     * */
    @GetMapping("getRightsList")
    public SysResult getAllRight(){
        List<Right> rights = rightService.getAllRight();
        return SysResult.success(rights);
    }
}
